% TeX input file for testing OzTeX with a very nasty DVI file.
% First 11 pages are nasty but should not cause any error messages.
% Remaining pages contain one or more deliberate errors.

% \xxx   % deliberate error for guided tour in OzTeX User Guide

\nopagenumbers
\topskip 0pt
\parindent 0pt
\parskip 0pt

% DVI page 1
\message{Empty page.}
\null
\vfil\eject

% DVI page 2
\message{Page with origin check.}
\hrule width 1in height 1cm
\vskip 1in
The top left corner of the above rule should be exactly
1in in from the top left corner of the paper.
The rule itself should be 1in wide and 1cm high.
\vfil\eject

% DVI page 3
\message{Page with special commands.}
{% change page size temporarily
\vsize=10in
\offinterlineskip
\null
% create 1in lattice for checking positions and measurements
\def\wd{7}
\def\ht{10}
\newcount\temp
\vbox to 0pt{
\hbox to \wd in
{\temp=\wd
\loop\ifnum\temp>0
   \vrule height \ht in width 0.1pt
   \hfil
   \advance\temp by -1
\repeat
\vrule height \ht in width 0.1pt
}\vss}
\vbox to \ht in
{\temp=\ht
\loop\ifnum\temp>0
   \hrule height 0.1pt width \wd in
   \vfil
   \advance\temp by -1
\repeat
\hrule height 0.1pt width \wd in
}
\vskip -\ht in

\special{empty.ps}                            % empty file
\special{box.ps 1.5 .5 scale}                 % optional PostScript text
\hskip 2in
\special{epsf=offset.epsf scale=0.25}         % offset BoundingBox
\vskip 4in
\hbox{\hskip 2in \special{epsf=test.epsf}}    % EPSF file
\vskip 2in
\special{pict=test.pict}                      % PICT file
\hskip 2in
\special{pict=test.pict height=144 width=36}% % 2in high, 0.5in wide
\hskip 2in
\special{pict=:test.pict scale=0.5}           % half size, and only look in current folder
\vskip 3in
\special{pntg=test.pntg}                      % MacPaint file
\hskip 3in
\special{pntg=test.pntg scale=0.5}%           % half size
\hskip 2in
\special{pntg=test.pntg hscale=.5 vscale=1.5} % half as wide, 50% higher
\vskip 1in
\special{pntg=test.pntg height=72}            % 72bp = 1in high (keep aspect ratio)
\hskip 3in
\special{pntg=test.pntg height=36 width=72}   % 0.5in high, 1in wide
\vfil\eject
}% reset page size

% DVI page 4
\message{Page with nastier special commands.}
{% change page size temporarily
\vsize=11in
\voffset=-1in
\hoffset=-1in
\null
\vskip 5in
\special{pntg=test.pntg ht 72 wd 36 hscale 2.0}   % ht = 1in, wd = 4in
\vskip 3in
\special{pntg=test.pntg scale  2.0 wd  36 }       % wd = 0.5in, ht = 0.5in
\vskip 2in
\special{macpaint=blank.pntg    }                 % no bitmap
\special{pntg=::TeX-docs:maxbounds.pntg}          % largest MacPaint image
\special{pntg= 1dot.pntg}                         % single pixel
% next \special marker is off paper but no error occurs
\llap{\hbox to 1in{\special{macpaint=blank.pntg}\hfill}}
\vfil\eject
}% reset page size

% DVI page 5
\message{Page with 1 black pixel at (0,0).}
\hrule height 1sp width 1sp depth 0sp
\vfil\eject

% DVI page 6
\message{A4 paper filled with 1mm grid.}
{% change page size and location temporarily
\hoffset=-1in
\voffset=-1in
\hsize=209.9mm
\vsize=295.9mm
\newcount\temp
\hbox to \hsize
{\temp=209
\loop\ifnum\temp>0
   \vrule height \vsize width 1sp
   \hfil
   \advance\temp by -1
\repeat
\vrule height \vsize width 1sp
}
\vskip -\vsize
\temp=296
\loop\ifnum\temp>0
   \hrule height 1sp width \hsize
   \vfil
   \advance\temp by -1
\repeat
\hrule height 1sp width \hsize
\eject
}% reset page size and location

% DVI page 7
\message{Multiple TeX page counters.}
\footline={\hss\tenrm\folio\hss}   % turn on page numbers
\pageno=0
\count1=1 \count2=2 \count3=3 \count4=4  \count9=9
\noindent
This is \TeX\ page [0.1.2.3.4.....9].
\vfil\eject
\count1=0 \count2=0 \count3=0 \count4=0  \count9=0   % reset TeX counters

% DVI page 8
\message{Negative TeX page.}
\pageno=-99
This is \TeX\ page [-99].
\vfil\eject
\pageno=0          % restart TeX page numbers
\nopagenumbers     % turn off page numbers again

% DVI page 9
\message{Standard paragraphs in CM and virtual PS fonts.}

\input psnames
\input pstext

\font\timesr=\TimesR at 10pt
\font\huge=\Helv at 123.4pt

\rm
``the quick brown fox jumps over a lazy dog''\par
``THE QUICK BROWN FOX JUMPS OVER A LAZY DOG''\par
ligatures: fluffy, waffle, firefly, difficult, en--dash, em---dash\par
kerning: boxer, cooked, vowel\par
`foreign' letters:\par
\'o \`o \^o \"o \~o \=o \u o \v o \H o \.o \c o \d o \b o
\oe\ \OE\ \ae\ \AE\ \aa\ \AA\ \o\ \O\ \l\ \L\ \ss\ \i\ \j

\bigskip

{\timesr\PStext
``the quick brown fox jumps over a lazy dog''\par
``THE QUICK BROWN FOX JUMPS OVER A LAZY DOG''\par
ligatures: fluffy, waffle, firefly, difficult, en--dash, em---dash\par
kerning: boxer, cooked, vowel\par
`foreign' letters:\par
\'o \`o \^o \"o \~o \=o \u o \v o \H o \.o \c o \d o \b o
\oe\ \OE\ \ae\ \AE\ \aa\ \AA\ \o\ \O\ \l\ \L\ \ss\ \i\ \j
\par
extra characters available in virtual PostScript fonts:\par
\pounds\ \guillemotleft\ \guillemotright\ \guilsinglleft\ 
\guilsinglright\ \quotesinglbase\ \quotedblbase

}

\bigskip
\rm The cat sat on the mat. \timesr The cat sat on the mat.
i\rm i\timesr i\rm i\timesr i\rm i\timesr i

\vskip 1in
\huge huge

\rm
\vfil\eject

% DVI page 10
\message{Verbatim tt strings.}
\input verbatim
\begintt
--------------------------------------------------------------------------------
-                                                                              -
--------------------------------------------------------------------------------
\endtt
\vfil\eject

% DVI page 11
\message{All-white character.}
\font\cmtex=cmtex10
\leftline{\cmtex a\char32 b}
\vfil\eject

% REMAINING PAGES HAVE DELIBERATE ERRORS...

% DVI page 12
\pageno=100
\message{Page with missing PK fonts.}
\font\FA=logo10 scaled 1
\font\FB=logo10 scaled 10000
\leftline{\FA METAFONT}
\vskip 3in
\leftline{\FB METAFONT}
\vfil\eject

% DVI page 13
\message{Page beyond top and left edges of A4 paper.}
{% change page size and location
\voffset -3in
\hoffset -9in
\leftline{Page off paper.}
\vfil\eject
}% restore page size and location

% DVI page 14
\message{Page beyond bottom and right edges of A4 paper.}
{% change page size and location
\voffset 3in
\hoffset 9in
\null\vfil
\rightline{Page off paper.}
\eject
}% restore page size and location

% DVI page 15
\message{Page beyond all edges of A4 paper.}
{% change page size and location
\voffset -3in
\hoffset -3in
\vsize 15in
\hsize 15in
\line{Page off paper.\hfil Page off paper.}
\vfil
\line{Page off paper.\hfil Page off paper.}
\eject
}% restore page size and location

% DVI page 16
\message{Page with illegal special commands.}
\null
\vskip 1in
\special{}
\medskip
\special{ }
\medskip
\special{""}
\medskip
\special{" "}
\medskip
\special{"x"}
\medskip
\special{x}
\medskip
\special{x=}
\medskip
\special{=yyy}
\medskip
\special{% will be truncated
12345678901234567890123456789012345678901234567890%
12345678901234567890123456789012345678901234567890%
12345678901234567890123456789012345678901234567890%
12345678901234567890123456789012345678901234567890%
12345678901234567890123456789012345678901234567890%
1234567}
\medskip
\special{pict= test.pict unknown-key=foo}
\medskip
\special{pict=test.pict scale=bad-real}
\medskip
\special{pict=  test.pict scale= }            % no scale value
\medskip
\special{pntg= test.pntg scale=-1}            % -ve scale not allowed
\medskip
\special{pntg= test.pntg hscale=.5 vscale=.1  scale=.}   % zero scale not allowed
\medskip
\special{pntg=test.pntg scale=100.1}          % number too large
\medskip
\special{pntg=test.pntg width=0.0}            % zero dimen not allowed
\medskip
\special{pntg=test.pntg height=32000.1}       % number too large
\vfil\eject

% DVI page 17
\message{Page with bad special files.}
\null
\vskip 1in
\special{pict= test.epsf}     % wrong type
\medskip
\special{pntg=test.pict}      % wrong type
\medskip
\special{epsf=test.pntg}      % wrong type
\medskip
\special{epsf=nopict.epsf}    % no PICT 256 resource
\medskip
\special{pict=unknown-file}
\medskip
\special{ empty.ps   }
\medskip
\special{    "empty.ps" (hello ) print flush}
\medskip
\special{"empty.ps"(hello again) print flush}
\medskip
\special{bad.ps}              % has deliberate PostScript error
\vfil\eject

% DVI page 18
% PostScript printers can get 1 pixel rounding errors which show up in TeX
% math extension symbols made up of rules and cmex characters.
% DVItoPS.PS tries to minimize such problems by making slight adjustments
% to the height, width and positioning of rules.

\message{Page with possible rounding problems.}

\hrule width 2in height 1mm
\bigskip

\def\prob{$$\shift
\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}}
\quad
\{\underbrace{\overbrace{\mathstrut a,\ldots,a}
     ^{k\;{\tenit a's}},
\overbrace{\mathstrut b,\ldots,b}
     ^{l\;{\tenit b's}}}_{k+l\rm\;elements}\}.
\quad
\left\{\vbox to 27pt{}\left\{\vbox to 24pt{}\left\{
\vbox to 21pt{}\Biggl\{\biggl\{\Bigl\{
\bigl\{{\bf t}\bigr\}\Bigr\}\biggr\}
\Biggr\}\right\}\right\}\right\}
$$}

\def\shift{}
\prob
\bigskip

\def\shift{\hskip 10pt}
\prob
\bigskip\bigskip

\def\shift{\hskip 20pt}
\prob
\bigskip\bigskip\bigskip

\def\shift{\hskip 30pt}
\prob

\vfil\eject

% DVI page 19
\message{Page will exceed VM in LaserWriter 2.0.}
\font\huge=cminch
\font\bigrm=cmr10 scaled\magstep5
\font\bigbf=cmbx10 scaled\magstep5
\font\bigit=cmti10 scaled\magstep5
\font\bigsl=cmsl10 scaled\magstep5
\font\bigtt=cmtt10 scaled\magstep5
\hrule
\vfil
\centerline{\huge ABCDE}
\vfil
\centerline{\bigrm This is the largest ROMAN}
\centerline{\bigbf This is the largest BOLD}
\centerline{\bigit This is the largest ITALIC}
\centerline{\bigsl This is the largest SLANTED}
\centerline{\bigtt This is the largest TYPEWRITER}
\vfil
\rm
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\hfil\break
Some ligatures: fluffy, difficult, deftly.  Some kerning: book, box, AVATAR.
Here is a paragraph using the PLAIN output format.
Let us hope we see some improvement. If not, think again.
The cat sat on the mat.
\bigskip
\bf
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\hfil\break
Some ligatures: fluffy, difficult, deftly.  Some kerning: book, box, AVATAR.
Here is a paragraph using the PLAIN output format.
Let us hope we see some improvement. If not, think again.
The cat sat on the mat.
\bigskip
\it
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\hfil\break
Some ligatures: fluffy, difficult, deftly.  Some kerning: book, box, AVATAR.
Here is a paragraph using the PLAIN output format.
Let us hope we see some improvement. If not, think again.
The cat sat on the mat.
\bigskip
\sl
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789\hfil\break
Some ligatures: fluffy, difficult, deftly.  Some kerning: book, box, AVATAR.
Here is a paragraph using the PLAIN output format.
Let us hope we see some improvement. If not, think again.
The cat sat on the mat.
\bigskip
\tt
{\obeylines
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789

}
\rm
\vfil
\hrule
\eject

\bye
